use std::collections::HashSet;

struct Solution {}

fn main() {}

impl Solution {
    pub fn contains_duplicate(nums: Vec<i32>) -> bool {
        let mut num_set = HashSet::new();
        for num in nums.iter() {
            if !num_set.contains(num) {
                num_set.insert(num);
                continue;
            }
            num_set.remove(num);
        }
        num_set.len() != nums.len()
    }
}